package cn.exrick.xboot.modules.news.serviceimpl;

import cn.exrick.xboot.modules.news.dao.mapper.NewsImagesMapper;
import cn.exrick.xboot.modules.news.entity.NewsImages;
import cn.exrick.xboot.modules.news.service.INewsImagesService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Wrapper;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 测试接口实现
 * @author Exrick
 */
@Slf4j
@Service
@Transactional
public class INewsImagesServiceImpl extends ServiceImpl<NewsImagesMapper, NewsImages> implements INewsImagesService {

    @Autowired
    private NewsImagesMapper newsImagesMapper;


    /**
     * 分页查询
     * @param page
     * @return
     */
    public IPage<NewsImages> findByPage(Page<NewsImages> page,NewsImages n){

        return   newsImagesMapper.selectPage(page,null);

    }

    public IPage<NewsImages> selectPageVo(Page page, @Param("old_name")String old_name){
        return newsImagesMapper.selectPageVo(page,old_name);
    }
    /**
     * 20190730
     * njp
     * 根据新闻id删除
     * map 为参数
     */
    public boolean deleteNewsImagesByNewsId( @Param("map") Map<String,Object> map){
        return newsImagesMapper.deleteNewsImagesByNewsId(map);
    }

    /**
     * 20190730
     * njp
     * 根据新闻查询
     * map 为参数
     */
    public NewsImages selectNewsImagesByNewsId( @Param("id")String id){
        return newsImagesMapper.selectNewsImagesByNewsId(id);
    }



}